﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.DALFactory;

// test only
using KPIS.GERP.GFMS.DAL;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_HRM_PR_ExtraTypes : IBLL_HRM_PR_ExtraTypes
    {
        Common common = new Common();
        private static readonly IDAL_HRM_PR_ExtraTypes dal = DataAccess.Create_HRM_PR_ExtraTypes();
        //IBLL_HRM_PR_PayrollDtls r = new B_HRM_PR_PayrollDtls();

        public B_HRM_PR_ExtraTypes()
        {

        }

        public IList<M_HRM_PR_ExtraTypes> GetFull(string emp_type_seq, string ext_flag
            , string ext_tax, string ext_monthly)
        {
            Nullable<int> nemp_type_seq = common.ConvertNullInt(emp_type_seq);
            return dal.GetFull(nemp_type_seq, ext_flag, ext_tax, ext_monthly);
        }

        public IList<M_HRM_PR_ExtraTypes> GetList(string emp_type_seq, string ext_flag
            , string ext_tax, string ext_monthly)
        {
            Nullable<int> nemp_type_seq = common.ConvertNullInt(emp_type_seq);
            return dal.GetList(nemp_type_seq, ext_flag, ext_tax, ext_monthly);
        }

        public IList<M_HRM_PR_ExtraTypes> GetMoneyReqIncomeList(string pay_seq)
        {
            Nullable<int> npay_seq = common.ConvertNullInt(pay_seq);
            return dal.GetMoneyReqIncomeList(npay_seq);
        }

        public M_HRM_PR_ExtraTypes GetInfo(string seq)
        {
            int nSeq;
 
            if (seq == null)
                return null;

            if (common.IsNumeric(seq))
            {
                nSeq = int.Parse(seq);
                return dal.GetInfo(nSeq);
            }
            else
            {
                return null;
            }
        }

        public void Insert(M_HRM_PR_ExtraTypes info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }

        public void Update(M_HRM_PR_ExtraTypes info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(M_HRM_PR_ExtraTypes info)
        {
            try
            {
                dal.Delete(info);
            }
            catch
            {
                throw;
            }
        }
    }
}
